package com.xyazm.order.mq.producer;

import com.xyazm.common.enums.RocketMqTopicEnum;
import lombok.extern.slf4j.Slf4j;
import org.apache.rocketmq.client.producer.TransactionMQProducer;
import org.apache.rocketmq.spring.autoconfigure.RocketMQProperties;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * 订单缺品实际退款producer组件
 * @author xuyou
 * @date 2022年12月11日 21:49
 */
@Slf4j
@Component
public class LackItemProducer extends AbstractTransactionProducer {

    @Autowired
    public LackItemProducer(RocketMQProperties rocketMQProperties) {
        producer = new TransactionMQProducer(RocketMqTopicEnum.ACTUAL_REFUND.getProducerGroup());
        producer.setNamesrvAddr(rocketMQProperties.getNameServer());
        start();
    }

}
